home *** CD-ROM | disk | FTP | other *** search
/ Aminet 24 / Aminet 24 (1998)(GTI - Schatztruhe)[!][Apr 1998].iso / Aminet / dev / e / AEPD09.lha / EPD09 / Amiga_E-Programme / ESEE / GoldED / Parsers / PROC.devpac < prev   
Text File  |  1994-08-18  |  2KB  |  59 lines

  1. *
  2. * PROC.devpac - by Leon Woestenberg 1993, fully public domain.
  3. * ~~~~~~~~~~~
  4. * Description
  5. * ~~~~~~~~~~~
  6. * ESEE 'PROC' Section Parser in assembly language.
  7. *
  8. * Function
  9. * ~~~~~~~~
  10. * Can be called by GoldED to parse one line for PROC indexing.
  11. *
  12. * Input (comes from GoldED)
  13. * ~~~~~
  14. * a0 - address of stringpointer to line
  15. * d0 - length of the line
  16. *
  17. * Output (goes to GoldED)
  18. * ~~~~~~
  19. * a0 - address of stringpointer to functionname
  20. * d0 - length of functionname
  21. *
  22. * GoldED Settings
  23. * ~~~~~~~~~~~~~~~
  24. * It's advicable to set the file extension to '*.e' for this parser. This
  25. * can be done in GoldED's Sections window called by GoldED's FUNC command.
  26. *
  27.  
  28.         move.l  a1,-(a7)        * store a1
  29.         move.l  (a0),a1         * stringpointer to a1
  30.         cmp.b   #80,(a1)        * char P?
  31.         bne     not
  32.         cmp.b   #82,1(a1)       * char R?
  33.         bne     not
  34.         cmp.b   #79,2(a1)       * char O?
  35.         bne     not
  36.         cmp.b   #67,3(a1)       * char C?
  37.         bne     not
  38.         cmp.b   #32,4(a1)       * space?
  39.         bne     not
  40.         add.l   #5,a1           * stringpointer to functionname
  41.         add.l   #5,(a0)         * idem dito
  42.         move.l  d0,d1           * copy string length to d1
  43.         clr.l   d0              * initialize d0 for search
  44.  
  45. find:
  46.         cmp.b   #40,(a1)        * char (?
  47.         beq     end
  48.         add.l   #1,a1           * increase charpointer
  49.         add.l   #1,d0           * increase length
  50.         cmp.b   d0,d1           * line length reached?
  51.         beq     not     
  52.         jmp     find            * check next char
  53.  
  54. not:
  55.         clr.l   d0              * no success, return zero
  56. end:
  57.         move.l  (a7)+,a1        * restore a1
  58.         rts                     * bye bye
  59.